home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Oberon / source / amiga / Serial.mod < prev    next >
Text File  |  1995-06-29  |  5KB  |  133 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: Serial.mod $
  4.   Description: external declarations for the serial device
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.8 $
  8.       $Author: fjc $
  9.         $Date: 1995/06/04 23:13:14 $
  10.  
  11.   $VER: serial.h 33.6 (6.11.90)
  12.   Includes Release 40.15
  13.  
  14.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  15.       All Rights Reserved
  16.  
  17.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  18.   This file is part of the Oberon-A Interface.
  19.   See Oberon-A.doc for conditions of use and distribution.
  20.  
  21. ***************************************************************************)
  22.  
  23. <* STANDARD- *>
  24.  
  25. MODULE [2] Serial;
  26.  
  27. IMPORT e := Exec, s := Sets;
  28.  
  29.  
  30.                    (* array of termination char's *)
  31.                    (* to use,see serial.doc setparams *)
  32.  
  33. TYPE
  34.  
  35.   IOTArrayPtr * = POINTER TO IOTArray;
  36.   IOTArray * = ARRAY 8 OF CHAR;
  37.  
  38. CONST
  39.  
  40.   defaultCtlChar * = 11130000H;  (* default chars for xON,xOFF *)
  41.  
  42. (* You may change these via SETPARAMS.  At this time, parity is not
  43.    calculated for xON/xOFF characters.  You must supply them with the
  44.    desired parity. *)
  45.  
  46. (******************************************************************)
  47. (* CAUTION !!  IF YOU ACCESS the serial.device, you MUST (!!!!) use an
  48.    IOExtSer-sized structure or you may overlay innocent memory !! *)
  49. (******************************************************************)
  50.  
  51. TYPE
  52.  
  53.   IOExtSerPtr * = POINTER TO IOExtSer;
  54.   IOExtSer * = RECORD (e.IORequestBase)
  55.     ioSer *     : e.IOStdReq;
  56.     ctlChar *   : e.ULONG;  (* control char's (order = xON,xOFF,INQ,ACK) *)
  57.     rBufLen *   : e.ULONG;  (* length in bytes of serial port's read buffer *)
  58.     extFlags *  : s.SET32;  (* additional serial flags (see bitdefs below) *)
  59.     baud *      : e.ULONG;  (* baud rate requested (true baud) *)
  60.     brkTime *   : e.ULONG;  (* duration of break signal in MICROseconds *)
  61.     termArray * : IOTArray; (* termination character array *)
  62.     readLen *   : SHORTINT;  (* bits per read character (# of bits) *)
  63.     writeLen *  : SHORTINT;  (* bits per write character (# of bits) *)
  64.     stopBits *  : SHORTINT;  (* stopbits for read (# of bits) *)
  65.     serFlags *  : s.SET8;   (* see SerFlags bit definitions below  *)
  66.     status *    : s.SET16;
  67.   END; (* IOExtSer *)
  68.  
  69.    (* status of serial port, as follows:
  70. *                  BIT  ACTIVE  FUNCTION
  71. *                   0    ---    reserved
  72. *                   1    ---    reserved
  73. *                   2    high   Connected to parallel "select" on the A1000.
  74. *                               Connected to both the parallel "select" and
  75. *                               serial "ring indicator" pins on the A500
  76. *                               & A2000.  Take care when making cables.
  77. *                   3    low    Data Set Ready
  78. *                   4    low    Clear To Send
  79. *                   5    low    Carrier Detect
  80. *                   6    low    Ready To Send
  81. *                   7    low    Data Terminal Ready
  82. *                   8    high   read overrun
  83. *                   9    high   break sent
  84. *                  10    high   break received
  85. *                  11    high   transmit x-OFFed
  86. *                  12    high   receive x-OFFed
  87. *               13-15           reserved
  88. *)
  89.  
  90. CONST
  91.  
  92.   query     * =     e.nonstd;     (* $09 *)
  93.   break     * =     e.nonstd+1;   (* $0A *)
  94.   setParams * =     e.nonstd+2;   (* $0B *)
  95.  
  96.  
  97.   xDisabled  * = 7;       (* ioSerFlags xOn-xOff feature disabled bit *)
  98.   eofMode    * = 6;       (*    "     EOF mode enabled bit *)
  99.   shared     * = 5;       (*    "     non-exclusive access bit *)
  100.   radBoogie  * = 4;       (*    "     high-speed mode active bit *)
  101.   queuedBrk  * = 3;       (*    "     queue this Break ioRqst *)
  102.   sevenWire  * = 2;       (*    "     RS232 7-wire protocol *)
  103.   partyOdd   * = 1;       (*    "     parity feature enabled bit *)
  104.   partyOn    * = 0;       (*    "     parity-enabled bit *)
  105.  
  106. (* These now refect the actual bit positions in the ioStatus UWORD *)
  107.   xOffRead *   = 12;     (* ioStatus receive currently xOFF'ed bit *)
  108.   xOffWrite *  = 11;     (*    "     transmit currently xOFF'ed bit *)
  109.   readBreak *  = 10;     (*    "     break was latest input bit *)
  110.   wroteBreak * = 9;      (*    "     break was latest output bit *)
  111.   overRun *    = 8;      (*    "     status word RBF overrun bit *)
  112.  
  113.  
  114.   mSpOn     * = 1;       (* ioExtFlags. Use mark-space parity, *)
  115.                          (*          instead of odd-even. *)
  116.   mark      * = 0;       (*    "     if mark-space, use mark *)
  117.  
  118.  
  119.   devBusy         * = 1;
  120.   baudMismatch    * = 2; (* baud rate not supported by hardware *)
  121.   bufErr          * = 4; (* Failed to allocate new read buffer *)
  122.   invParam        * = 5;
  123.   lineErr         * = 6;
  124.   parityErr       * = 9;
  125.   timerErr       * = 11; (*(See the serial/OpenDevice autodoc)*)
  126.   bufOverflow    * = 12;
  127.   noDSR          * = 13;
  128.   detectedBreak  * = 15;
  129.  
  130.   serialName * = "serial.device";
  131.  
  132. END Serial.
  133.